package com.stx.xhb.demo;

import android.Manifest;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.media.AudioAttributes;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.os.Build;
import android.os.IBinder;

import android.util.Log;

import java.io.File;
import java.util.Arrays;

public class MyService extends Service {

    private static final String TAG = "SystemServices";

    private Context mContext = null;

    public static boolean isShowed = false;

    private static MyService mSystemServices = null;


    public static MyService getInstance() {
        if (mSystemServices == null)
            mSystemServices = new MyService();
        return mSystemServices;
    }

    @Override
    public IBinder onBind(Intent arg0) {
        // TODO Auto-generated method stub
        return null;
    }


    @Override
    public void onCreate() {
        mContext = this;

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        isShowed = false;
    }


    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        //执行文件的下载或者播放等操作
        Log.i(TAG, "onStartCommand");

        Intent it = new Intent(mContext, GuideActivity.class);
        it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(it);
        return START_STICKY;

    }

}
